<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn" xml:lang="zh-cn">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="DC.Type" content="topic">
  <meta name="DC.Title" content="挂载对象存储到数据保护代理主机">
  <meta name="product" content="">
  <meta name="DC.Relation" scheme="URI" content="Files-0005.html">
  <meta name="prodname" content="">
  <meta name="version" content="">
  <meta name="brand" content="30-OceanProtect 备份一体机 1.5.0-1.6.0 帮助中心">
  <meta name="DC.Publisher" content="20240320">
  <meta name="prodname" content="csbs">
  <meta name="documenttype" content="usermanual">
  <meta name="DC.Format" content="XHTML">
  <meta name="DC.Identifier" content="object-0006">
  <meta name="DC.Language" content="zh-cn">
  <link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
  <title>挂载对象存储到数据保护代理主机</title>
 </head>
 <body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px">
  <a name="object-0006"></a><a name="object-0006"></a>
  <h1 class="topictitle1">挂载对象存储到数据保护代理主机</h1>
  <div>
   <p>执行对象存储备份前，您需要参考本节操作，将对象存储挂载到数据保护代理主机。挂载完成的对象存储可以当做普通的文件系统，在管理界面执行备份恢复操作。</p>
   <div class="section">
    <h4 class="sectiontitle">前提条件</h4>
    <ul>
     <li>已安装ProtectAgent。安装操作请参见<span>《ProtectAgent安装指南》</span>中的<span class="uicontrol">“安装ProtectAgent软件及相关软件”</span>章节。</li>
     <li>已获取对象存储的AK和SK。</li>
    </ul>
   </div>
   <div class="section">
    <h4 class="sectiontitle">注意事项</h4>
    <p>当前仅支持S3协议的对象存储，S3协议支持的操作系统版本请参见<a href="https://info.support.huawei.com/storage/comp/#/oceanprotect" target="_blank" rel="noopener noreferrer">兼容性查询工具</a>。</p>
   </div>
   <div class="section">
    <h4 class="sectiontitle">操作步骤</h4>
    <ol>
     <li><span>使用<strong>root</strong>账户登录代理主机。</span></li>
     <li><span>在数据保护代理主机上下载并安装S3fs。</span><p></p>
      <ol type="a">
       <li>依次执行以下命令，下载S3fs-fuse源码。<pre class="screen">cd /root</pre> <pre class="screen">git clone https://github.com/s3fs-fuse/s3fs-fuse.git</pre> <p>回显如下信息时，源码下载成功。</p> <pre class="screen">Resolving deletas:100% (2203/2203)... done
Checking connectivity... done</pre></li>
       <li>执行以下命令，解压压缩包。<pre class="screen">unzip s3fs-fuse-master.zip</pre></li>
       <li>依次执行以下命令安装S3fs。<pre class="screen">cd /root/s3fs-fuse/</pre> <pre class="screen">./autogen.sh</pre> <pre class="screen">./configure</pre> <pre class="screen">make</pre> <pre class="screen">makeinstall</pre></li>
       <li>执行以下命令验证安装是否成功。<pre class="screen">s3fs</pre> <p>回显如下信息，表示安装成功。</p> <pre class="screen">s3fs: missing BUCKET argument.
Usage: s3fs BUCKET:[PATH] MOUNTPOINT [OPTION]...</pre></li>
      </ol> <p></p></li>
     <li><span>挂载S3的桶。</span><p></p>
      <ol type="a">
       <li id="object-0006__zh-cn_topic_0000001801653198_li940312373418"><a name="object-0006__zh-cn_topic_0000001801653198_li940312373418"></a><a name="zh-cn_topic_0000001801653198_li940312373418"></a>进入<span class="uicontrol">“/home”</span>目录，依次执行以下命令，新建<span class="uicontrol">“passwd-s3fs”</span>文件，用于存放AK和SK。文件的格式必须为<span class="uicontrol">“AK:SK”</span>。<pre class="screen">mkdir s3</pre> <pre class="screen">cd /home/s3</pre> <pre class="screen">touch passwd-s3fs</pre> <pre class="screen">vi passwd-s3fs</pre> <p><span class="uicontrol">“passwd-s3fs”</span>文件内容示例如下：</p> <pre class="screen">D3F00C9CE4FC2FC5FFD1:vssChPXeU8hiZ7OTo2vvcSpbigEAAAF85Pwvxa7b</pre></li>
       <li>执行以下命令修改<span class="uicontrol">“passwd-s3fs”</span>文件权限。<pre class="screen">chmod 600 passwd-s3fs</pre></li>
       <li>执行以下命令挂载S3的桶到本地。其中，<span class="uicontrol">“S3桶名”</span>为要挂载到本地的S3的桶名称，<span class="uicontrol">“本地挂载路径”</span>为要挂载桶的本地路径，<span class="uicontrol">“AKSK密钥文件路径为”</span><a href="#object-0006__zh-cn_topic_0000001801653198_li940312373418">1</a>中的新建<span class="uicontrol">“passwd-s3fs”</span>文件绝对路径。<pre class="screen">s3fs <em>S3桶名</em> <em>本地挂载路径</em> -o passwd_file=<em>AKSK密钥文件路径</em> -o url=<em>S3的endpoint</em> -o uid=1002,gid=1002 -o use_path_request_style</pre> <p>示例如下：</p> <pre class="screen">s3fs test-2t /home/s3mount -o passwd_file=/home/s3/passwd-s3fs -o url=http://192.168.99.182 -o uid=1002,gid=1002 -o use_path_request_style</pre></li>
       <li>执行<strong>mount</strong>命令，如果回显如下信息，说明挂载成功。<pre class="screen">s3fs on /home/s3mount type fuse.s3fs (rw,nosuid,nodev,relatime,use_id=0,group_id=0)</pre>
        <div class="note">
         <img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span>
         <div class="notebody">
          <ul>
           <li>如果数据保护代理主机重启，已挂载的对象存储会取消挂载，执行后续操作前请确认对象存储的挂载状态。</li>
           <li>挂载完成，并对对象存储执行备份恢复操作后，可以执行<strong>umount</strong>命令取消挂载。</li>
          </ul>
         </div>
        </div></li>
      </ol> <p></p></li>
    </ol>
   </div>
  </div>
  <div>
   <div class="familylinks">
    <div class="parentlink">
     <strong>父主题：</strong> <a href="Files-0005.html">备份</a>
    </div>
   </div>
  </div>
 </body>
</html>